package com.example.seckilldemo.controller;


import com.example.seckilldemo.pojo.User;
//import com.example.seckilldemo.rabbitmq.MQSender;
import com.example.seckilldemo.rabbitmq.MQSender;
import com.example.seckilldemo.vo.RespBean;
//import org.springframework.amqp.AmqpIllegalStateException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/user")
public class UserController {

//    @Autowired
//    private MQSender mqSender;
    /**
     * @description: 用户信息（测试）
     *
     * @param:
     * @return:
     */
    @RequestMapping("/info")
    @ResponseBody
    public RespBean info(User user){
        return RespBean.success(user);
    }

    /**
     * @description: 测试发送RabbitMQ消息
     *
     * @param:
     * @return:
     */
    /*
    @RequestMapping("/mq")
    @ResponseBody
    public void mq(){
        mqSender.send("Hello");
    }

    @RequestMapping("/mq/fanout")
    @ResponseBody
    public void mq01(){
        mqSender.send("Hello");
    }

    @RequestMapping("/mq/direct01")
    @ResponseBody
    public void mqD1(){
        mqSender.sendD1("Hello,Red");
    }

    @RequestMapping("/mq/direct02")
    @ResponseBody
    public void mqD2(){
        mqSender.sendD2("Hello,Green");
    }

    @RequestMapping("/mq/topic01")
    @ResponseBody
    public void mqT01(){
        mqSender.sendT1("Hello,Red");
    }
    @RequestMapping("/mq/topic02")
    @ResponseBody
    public void mqT02(){
        mqSender.sendT2("Hello,Green");
    }

    @RequestMapping("/mq/headers01")
    @ResponseBody
    public void mqH01(){
        mqSender.sendH01("Hello,Headers01");
    }
    @RequestMapping("/mq/headers02")
    @ResponseBody
    public void mqH02(){
        mqSender.sendH02("Hello,Headers02");
    }

     */
}
